package org.keyintegrity.webbeans.demo;

import org.apache.tapestry.components.Block;
import org.apache.tapestry.html.BasePage;
import org.keyintegrity.webbeans.demo.beans.ComplexJavaBean;
import org.keyintegrity.webbeans.demo.beans.DemoBeans;

public abstract class XsltBeanEditorDemo extends BasePage {

    private ComplexJavaBean complexJavaBean;
    
    public abstract Block getActiveBlock();
    public abstract void setActiveBlock(Block block);
    
    public Block getRenderedLayout() {
        return (Block) getComponent("renderedLayout");
    }
    
    public void showBlock(String blockId) {
        setActiveBlock((Block) getComponent(blockId));
    }
    
    public ComplexJavaBean getComplexJavaBean() {
        if (complexJavaBean == null) {
            complexJavaBean = DemoBeans.getComplexJavaBean();
        }
        return complexJavaBean;
    }
}
